package cn.qyd.lamda;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

/**
 * @author 邱运铎
 * @date 2024-04-05 0:43
 */
public class lamdaExprDemo {

    static class LamdaTest {
        public static void test1() {
            System.out.println("I am static method");
        }

        public void test2() {
            System.out.println("I am test2 method");
        }
    }
    public static void main(String[] args) {
        LamdaTest lamdaTest = new LamdaTest();
        List<LamdaTest> list = new ArrayList<>();
        list.add(lamdaTest);
        list.stream().forEach(LamdaTest::test2);
        list.stream().forEach(item -> item.test2());
        list.stream().forEach(item -> item.test1());
        Supplier<List<LamdaTest>> supplier = ArrayList::new;
        List<LamdaTest> list1 = supplier.get();
        list.add(lamdaTest);

    }
}
